package com.xrjsj.stage.exception;


import com.xrjsj.stage.constant.CommonEnum.ResultInfo;

public class CommonException extends RuntimeException {

    private Integer code;


    public CommonException(Integer code, String msg) {
        super(msg);
        this.code = code;
    }

    public CommonException(ResultInfo resultInfo) {
        super(resultInfo.getMsg());
        this.code = resultInfo.getCode();
    }
    public CommonException(String msg) {
        super(msg);
        this.code = ResultInfo.UNKOWN_ERROT.getCode();
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

}
